//
//  XDSelCityLocCityTCell.m
//  kabu
//
//  Created by XiangDongMBP on 2017/2/23.
//  Copyright © 2017年 East. All rights reserved.
//

#import "XDSelCityLocCityTCell.h"

@implementation XDSelCityLocCityTCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code

    self.titleBtn.layer.borderWidth = 1.0;
    self.titleBtn.layer.borderColor = [UIColor colorWithRed:(0xE0 / 255.0) green:(0xE0 / 255.0) blue:(0xE0 / 255.0) alpha:1.0].CGColor;
    
    [self.titleBtn addTarget:self action:@selector(titleBtnTapped:) forControlEvents:UIControlEventTouchUpInside];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setTitleStr:(NSString *)titleStr {
    _titleStr = titleStr;
    
    [self.titleBtn setTitle:titleStr forState:UIControlStateNormal];
    self.btnWidthConstraint.constant = (CGRectGetWidth(self.contentView.bounds) - 2*15.0 - 2 * 10.0) / 3.0;
}

- (void)titleBtnTapped:(UIButton *)btn {
    if ([self.delegate respondsToSelector:@selector(xDSelCityLocCityTCell:btnTapped:)]) {
        [self.delegate xDSelCityLocCityTCell:self btnTapped:btn];
    }
}

@end
